function calcBasicInfo(info) {
	var completeCount = 0,
		total = 7;
	completeCount += info.full_name ? 1 : 0;
	completeCount += info.industry_category_id && info.industry_category_id != 0 ? 1 : 0;
	completeCount += info.contact_person ? 1 : 0;
	completeCount += info.contact_phone ? 1 : 0;
	completeCount += info.contact_email ? 1 : 0;
	completeCount += info.address ? 1 : 0;
	completeCount += info.logo ? 1 : 0;
	return {
		complete: completeCount,
		total: total,
		done: completeCount === total
	};
};
function calcInfoComplete(info) {
	if (!info)

		return '';
	var keys = ['company_name', 'industry_category_id', 'contact_person', 'contact_phone', 'contact_email',
		'address', 'logo',
		'license_img', 'company_scale_id', 'company_type_id', 'intro'
	];
	var total = keys.length + 2,
		completeCount = 0;
	for (var i = 0; i < keys.length; i++) {
		completeCount += info[keys[i]] ? 1 : 0;
	}
	completeCount += info.benefits && info.benefits.length > 0 ? 1 : 0;
	completeCount += info.environment_images && info.environment_images.length > 0 ? 1 : 0;
	return parseInt(completeCount / total * 100);
}
module.exports = {
	calcInfoComplete: calcInfoComplete,
	calcBasicInfo: calcBasicInfo
};